package com.donghu.study;

import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet(urlPatterns = "/XyY/disenable")
public class UserdisEnableServlet extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
        String id = req.getParameter("id");

        String sql = "UPDATE `user` SET `disabled` = 0 WHERE `id` = ?";//0是禁用
        JdbcUtils.modify(sql, id);

        resp.sendRedirect("/XyY/user-list.jsp");
    }
}
